const Setting = require("./modules/settingModule");

//修改全局配置
const setSetting = async (info) => {
  await Setting.update(info, { where: { id: 1 } });
  const data = await Setting.findOne();
  return data.toJSON();
};

//获取全局配置
const getSetting = async () => {
  const data = await Setting.findOne();
  return data.toJSON();
};

module.exports = {
  setSetting,
  getSetting,
};
